package com.example.randomthoughts.daimasuixianglu.arrayfoundation.removingelements;

/**
 * @author csd
 * @version 1.0
 */
@SuppressWarnings({"all"})
public class Solution26 {
    public static void main(String[] args) {
        int nums[]={1,1};
        int i = removeDuplicates(nums);
        System.out.println("i = " + i);
    }
    public static int removeDuplicates(int[] nums) {
        int left=0;
        int n= nums.length;
        int flag=0;
        for (int right = left+1; right < n; right++) {
            if(nums[left] != nums[right]){
                nums[left + 1] = nums[right];
                left++;
            }
        }
        return left+1;

    }

}
